/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Client.persistence;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

/**
 *
 * @author Ripper
 */
public class PictureLoader 
{
    public PictureLoader()
    {
        
    }
    
    public BufferedImage getGreyValues(String id)
    {
        BufferedImage img = loadImage("gryval_"+id+".png");
        
        return img;
    }
    
    public BufferedImage getColourValues(String id)
    {
        BufferedImage img = loadImage("colval_"+id+".png");
        
        return img;
    }
    
    private BufferedImage loadImage(String img)
    {
        try
        {
            URL url = getClass().getResource(img);

            BufferedImage tehImg = ImageIO.read(url);
            return tehImg;
        }
        catch(IOException ex)
        {
            return null;
        }
    }
    
    public BufferedImage getImage(int id)
    {
        return loadImage("img_"+id+".png");
    }
    public BufferedImage getImage(String id)
    {
        return loadImage("img_"+id+".png");
    }
}
